﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using MiragePWF.NH.Validation;
using Wolfut.MirageEE.Kernal.Common;
using Wolfut.MirageEE.Domain.CommonUtilities;

namespace Wolfut.MirageEE.Domain.Products
{
    /// <summary>
    /// 仓库信息
    /// </summary>
    [ActiveRecord("WAREHOUSES")]
    [Serializable]
    public class Warehouse : PersistentObjectWithGuid
    {
        #region 仓库编号
        private String warehouseCode = String.Empty;
        [Property("WAREHOUSE_CODE")]
        [ValidateIsUniqueInSameTransactionWithString(false, "数据库已经存在相同的仓库编号！")]
        [ValidateNonEmpty, ValidateLength(0, 100, "仓库编号超长！")]
        public virtual string WarehouseCode
        {
            get
            {
                return warehouseCode;
            }
            set
            {
                warehouseCode = value;
            }
        }
        #endregion

        #region 仓库名称

        private String warehouseName = string.Empty;
        [Property("WAREHOUSE_NAME")]
        [ValidateNonEmpty, ValidateLength(0, 200, "仓库名称超长！")]
        public virtual string WarehouseName
        {
            get
            {
                return warehouseName;
            }
            set
            {
                warehouseName = value;
            }
        }
        #endregion

        #region 备注
        private String remarks = String.Empty;

        [Property("REMARKS")]
        [ValidateLength(0, 2000, "备注超长！")]
        public virtual string Remarks
        {
            get
            {
                return remarks;
            }
            set
            {
                remarks = value;
            }
        }
        #endregion

        #region 逻辑删除
        private Boolean isDeleted;
        [Property("IS_DELETED")]
        public virtual Boolean IsDeleted
        {
            get
            {
                return isDeleted;
            }
            set
            {
                isDeleted = value;
            }
        }
        #endregion
    }
}
